<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../../common/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<sfa:mainTitle></sfa:mainTitle>
		<%@ include file="../../common/meta.jsp"%>
		<script type="text/javascript"
			src="${path}/script/lhgdialog/lhgdialog.min.js">
</script>
		<script type="text/javascript">
function opendialog(url) {

	$.dialog( {
		title : '头像设置',
		lock : true,
		background : '#FFF',
		opacity : 0.1,
		max : true,
		min : true,
		width : '700px',
		height : '450px',
		content : 'url:' + url,
		close : function() {
			location.reload();
		}
	});
}

$(function(){
	$("#delete").click(function() {
		  
		//alert(saleNewsId);
			var url = "${path}/users/headPhoto/index/delete" ;
			art.dialog( {
				lock : true,
				content : '确定要删除吗？',
				ok : function() {
					art.dialog( {
						id : "loading",
						lock : true,
						drag : false,
						resize : false,
						title : "正在进行...",
						time : 5
					});
					$.post(url, null, function(result) {
						art.dialog( {
							id : 'loading'
						}).close();//关闭等待框
							if (result.flag) {
								art.dialog( {
									icon : "succeed",
									content : "删除成功!",
									lock : true,
									ok : function() {
										$("#photo").attr("src","${path}"+result.photo);
										 
										location.reload();
									}
								});
							} else {
								art.dialog( {
									icon : "error",
									content : "删除失败!",
									lock : true,
									ok : true
								});
							}

						});

					return true;
				},
				cancelVal : '取消',
				cancel : true
			//为true等价于function(){}
					});

		});
})
</script>
	</head>



	<body id="master">

		<sfa:mainHeader></sfa:mainHeader>

		<!--右边-->
		<div class="webpart3 contentarea">
			<div class="webpart-head">
				<div class="webpart-head-item">
					个人信息

				</div>
			</div>
			<div class="webpart-main">
				<div class="webpart-main-item" style="padding-top: 12px; text-align: left;">
						
							<table width="100%" border="0" cellspacing="0" cellpadding="10">
									<tr>
										<td><img alt="" src="${path }${photo}" id="photo"></td>
									</tr>
									<tr>
										<td>
											<span>用户名:</span>${user.loginName}
										</td>
									</tr>
									<tr>
										<td>
											<span>用户姓名:</span>${user.userName }
										</td>

									</tr>

									<tr>
										<td>
											<span>电子邮件:</span>${user.email }
										</td>

									</tr>
									<tr>
										<td>
											<span>手机号码:</span>${user.contactMobile}
										</td>

									</tr>
							</table>
							<input type="button" id="showPage" value="设置头像" class="linkbtn2"
								onclick="opendialog('${path}/users/headPhoto/index/setPage')">
							<c:if test="${requestScope.photo!=requestScope.defaultPic}">	
							<input type="button" id="delete" value="删除头像" class="linkbtn2"  />
							</c:if>
							<br />
				</div>
			</div>
			<div class="webpart-foot">
				<div class="webpart-foot-item">
				</div>
			</div>
		</div>
		<sfa:mainFooter></sfa:mainFooter>
	</body>
</html>


